package com.advice;

import org.aopalliance.aop.Advice;
import org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint;

public class MyAdvice implements Advice {
    public void beforeAdvice(){
        System.out.println("前制的增强");
    }
    public void afterAdvice(){
        System.out.println("后置的增强" );
    }
public  Object  around(MethodInvocationProceedingJoinPoint proceedingJoinPoint) throws Throwable {
    System.out.println("环绕前的增强");
        //环绕目标方法
   Object res =  proceedingJoinPoint.proceed();
    System.out.println("环绕后的增强");
   return res;
}
public void afterThrowingAdvice(){
    System.out.println("异常抛出通知...报异常才执行");
}
public  void afterAdvice1(){
    System.out.println("最终增强");
}
}
